//
//  HQHFreeDetailSecondTableViewCell.m
//  LastOne
//
//  Created by 小柠檬 on 15/11/14.
//  Copyright © 2015年 sc. All rights reserved.
//

#import "HQHFreeDetailSecondTableViewCell.h"
#import <UIImageView+WebCache.h>
#import "FitHeader.h"
#import "NightHeader.h"
@implementation HQHFreeDetailSecondTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(20 * FitWidth, 20 * FitHeight, 300 * FitWidth, 40 * FitHeight)];
        _titleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:20];
        [_titleLabel NightWithType:UIViewColorTypeNormal];
        [self.contentView addSubview:_titleLabel];
        
        self.coverimg = [[UIImageView alloc]initWithFrame:CGRectMake(_titleLabel.frame.origin.x, _titleLabel.frame.origin.y + _titleLabel.frame.size.height + 10 * FitHeight, 162.5 * FitWidth, 70 * FitHeight)];
        [self.contentView addSubview:_coverimg];
        
        self.contentLabel = [[UILabel alloc]initWithFrame:CGRectMake(_coverimg.frame.origin.x + _coverimg.frame.size.width + 10 * FitWidth, _coverimg.frame.origin.y, 162.5 * FitWidth, 70 * FitHeight)];
        _contentLabel.font = [UIFont fontWithName:@"Helvetica" size:15];
        _contentLabel.numberOfLines = 0;
        [_contentLabel NightWithType:UIViewColorTypeNormal];
        [self.contentView addSubview:_contentLabel];
        
    }
    return self;
}


-(void)setFreeWriteModel:(HQHFreeWriteModel *)freeWriteModel
{
    if (_freeWriteModel != freeWriteModel) {
        _freeWriteModel = freeWriteModel;
        
        _titleLabel.text = freeWriteModel.title;
        [_coverimg sd_setImageWithURL:[NSURL URLWithString:freeWriteModel.firstimage] placeholderImage:[UIImage imageNamed:@"placeholder"]];
        _contentLabel.text = freeWriteModel.shortcontent;
        
    }
}




/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
